package com.mo.ld.activity.animation

import android.os.Bundle
import com.mo.ld.databinding.ActivityLottieBinding
import com.mo.lib.ui.activity.BaseVbActivity

/**
 * @ author：mo
 * @ data：2022/3/28:10:01
 * @ 功能：
 */
class LottieActivity : BaseVbActivity<ActivityLottieBinding>() {
    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        var pro = 0f
        viewBinding.lavLottie.imageAssetsFolder = "images_loading" //设置data.json引用的图片资源文件夹名称,如果没有可不写
        viewBinding.lavLottie.setAnimation("loading.json") //通过AE生成的图文件(json格式)
        viewBinding.lavLottie.repeatCount = 10 //设置循环动画
        viewBinding.lavLottie.playAnimation()
//        viewBinding.lavLottie.addAnimatorUpdateListener {
//            viewBinding.tvLottie.text = (it.animatedFraction * 100).roundToInt().toString()
//        }
//        viewBinding.lavLottie.setClick {
//            pro += 0.01f
//            viewBinding.lavLottie.progress = pro
//        }

    }

    override fun initData() {
    }
}